package cn.starrysky108.simpleerp.finance.entity;

import cn.starrysky108.simpleerp.core.base.BaseEntity;
import cn.starrysky108.simpleerp.core.constant.Constants;
import cn.starrysky108.simpleerp.core.enums.OrderStatusEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 赊账订单表
 * </p>
 *
 * @author Carl Lee
 * @since 2021-08-14
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("finance_credit")
@ApiModel(value = "FinanceCredit对象", description = "赊账订单表")
public class FinanceCredit extends BaseEntity {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "流水号")
    @TableField("serial_number")
    private String serialNumber;

    @ApiModelProperty(value = "销售订单号")
    @TableField("sales_id")
    private Long salesId;

    @ApiModelProperty(value = "赊账人")
    @TableField("borrower_id")
    private Long borrowerId;

    @ApiModelProperty(value = "赊账人姓名")
    @TableField("borrower_name")
    private String borrowerName;

    @ApiModelProperty(value = "赊账时间")
    @TableField(value = "credit_time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Constants.DEFAULT_DATE_TIME_FORMAT)
    private LocalDateTime creditTime;

    @ApiModelProperty(value = "记账人")
    @TableField("recorder_id")
    private Long recorderId;

    @ApiModelProperty(value = "记账人姓名")
    @TableField("recorder_name")
    private String recorderName;

    @ApiModelProperty(value = "现场照片")
    @TableField("live_photos")
    private String livePhotos;

    @ApiModelProperty(value = "备注")
    @TableField("note")
    private String note;

    @ApiModelProperty(value = "录音")
    @TableField("recording")
    private String recording;

    @ApiModelProperty(value = "管理员/审核人id")
    @TableField("administrator_id")
    private Long administratorId;


    @ApiModelProperty(value = "订单状态")
    @TableField("status")
    private OrderStatusEnum status;

    @ApiModelProperty(value = "剩余未还")
    @TableField("unpaid")
    private BigDecimal unpaid;

}
